game_manager
{
	spawn
	{
	// mortis - mg clip exploit fix
		create
		{
			scriptName "bugfix1"
			classname "func_fakebrush"
			origin "-1936 384 232"
			contents 1  // CONTENTS_SOLID
			mins "-32 -40 -128"
			maxs "32 96 192"
		}

		// Ragnar: South pillar - fakebrush 
		create 
		{ 
			scriptname "pillar_fix1" 
			classname "func_fakebrush" 
			contents 65536 // CONTENTS_PLAYERCLIP 
			origin "-583 810 364" 
			mins "-20 -20 -92" 
			maxs "20 20 92" 
		} 

		// Ragnar: Second pillar from south - fakebrush 
		create 
		{ 
			scriptname "pillar_fix2" 
			classname "func_fakebrush" 
			contents 65536 // CONTENTS_PLAYERCLIP 
			origin "-583 1002 364" 
			mins "-20 -20 -92" 
			maxs "20 20 92" 
		} 

		// Ragnar: Second pillar from north - fakebrush 
		create 
		{ 
			scriptname "pillar_fix3" 
			classname "func_fakebrush" 
			contents 65536 // CONTENTS_PLAYERCLIP 
			origin "-583 1186 364" 
			mins "-20 -20 -92" 
			maxs "20 20 92" 
		} 

		// Ragnar: North pillar - fakebrush 
		create 
		{ 
			scriptname "pillar_fix4" 
			classname "func_fakebrush" 
			contents 65536 // CONTENTS_PLAYERCLIP 
			origin "-583 1378 364" 
			mins "-20 -20 -92" 
			maxs "20 20 92" 
		}

		// Ragnar: Display some text for anyone who got into the pillars. 
		create 
		{ 
			targetname "pillar_message_print" 
			scriptname "pillar_message_print" 
			message "^1WARNING: ^3ILLEGAL PLAYER LOCATION - PILLAR EXPLOIT." 
			origin "-583 810 364" 
			classname "target_print" 
		} 

		// Ragnar: South pillar - hurt 
		create 
		{ 
			scriptname "pillar1_hurt" 
			spawnflags 24 // SLOW+NO_PROTECTION 
			classname "trigger_hurt" 
			dmg 25 
			sound "sound/player/hurt_barbwire.wav" 
			origin "-583 810 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: South pillar - trigger text message 
		create 
		{ 
			scriptname "pillar1_message" 
			classname "trigger_multiple" 
			target "pillar_message_print" 
			origin "-583 810 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: Second pillar from south - hurt 
		create 
		{ 
			scriptname "pillar2_hurt" 
			spawnflags 24 // SLOW+NO_PROTECTION 
			classname "trigger_hurt" 
			dmg 25 
			sound "sound/player/hurt_barbwire.wav" 
			origin "-583 1002 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: Second pillar from south - trigger text message 
		create 
		{ 
			scriptname "pillar2_message" 
			classname "trigger_multiple" 
			target "pillar_message_print" 
			origin "-583 1002 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: Second pillar from north - hurt 
		create 
		{ 
			scriptname "pillar3_hurt" 
			spawnflags 24 // SLOW+NO_PROTECTION 
			classname "trigger_hurt" 
			dmg 25 
			sound "sound/player/hurt_barbwire.wav" 
			origin "-583 1186 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: Second pillar from north - trigger text message 
		create 
		{ 
			scriptname "pillar3_message" 
			classname "trigger_multiple" 
			target "pillar_message_print" 
			origin "-583 1186 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: North pillar - hurt 
		create 
		{ 
			scriptname "pillar4_hurt" 
			spawnflags 24 // SLOW+NO_PROTECTION 
			classname "trigger_hurt" 
			dmg 25 
			sound "sound/player/hurt_barbwire.wav" 
			origin "-583 1378 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		} 

		// Ragnar: North pillar - trigger text message 
		create 
		{ 
			scriptname "pillar4_message" 
			classname "trigger_multiple" 
			target "pillar_message_print" 
			origin "-583 1378 364" 
			mins "-4 -4 -92" 
			maxs "4 4 92" 
		}


		remapshader "models/mapobjects/tanks_sd/mg42turret" "models/mapobjects/tanks_sd/mg42turret_2"
		
		remapshaderflush
		
		//Fun stuff by PerloOung?!
		create
		{
			classname "misc_gamemodel"
			origin "-2580 -2345 300"
			model "models/mapobjects/tanks_sd/jagdpanther_africa_shell.md3"
			targetname "tank_shell2"
			scriptname "tank_shell2"
		}
		create
		{
			model "models/mapobjects/tanks_sd/jagdpanther_africa_turret.md3"
			origin "-2515 -2320 308"
			classname "misc_gamemodel"
			targetname "tank_turret3"
			scriptname "tank_turret3"
		}
		create
        {
            scriptname "reifenrechts_1"
            targetname "reifenrechts_1"
            origin "-2590 -2320 212"
            classname "script_mover"
            spawnflags 1
            model "*9"
            model2 "models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3"
        }
		//Fun stuff end
		
		// Game rules
		wm_number_of_objectives 1
		wm_set_round_timelimit	5

                setautospawn "Allied Spawn" 1
		setautospawn "Axis Spawn" 0

		// start triggered loops on/off
		
		disablespeaker allies_compost_sound		// allies command post
		disablespeaker axis_compost_sound		// axis command post
		disablespeaker axis_compost_sound_lms	// axis command post lms

		wait 1000
	}
}

cityflag
{
	spawn
	{
		
	wait 50
		remove
	}
}

cityspawns
{
	spawn
	{
		
	wait 50
		remove
	}
}

city_wobj
{
	spawn
	{
		

		remove
	}
}





bridge
{
	spawn
	{
		wait 400

		remove
	}
}

bridge_materials
{
	spawn
	{
		wait 400

		remove
	}
}

bridge_toi
{
	spawn
	{
		wait 400

		remove
	}
}


gate
{
	spawn
	{
		wait 400

		remove
	}
}

gate_toi
{
	spawn
	{
		wait 400

		remove
	}
}

gate_materials
{
	spawn
	{
		wait 400

		remove
	}
}

wall_toi
{
	spawn
	{
		wait 500
		remove
	}
}




boomtrigger
{
	spawn
	{
		wait 500
		remove
	}
}

hurt_barrelblast1
{
	spawn
	{
		wait 500
		remove
	}
}

hurt_barrelblast2
{
	spawn
	{
		wait 500
		remove
	}
}



hurt_wallblast
{
	spawn
	{
		wait 500
		remove
	}
}

// ---------------
// Team only doors
allied_door
{
	spawn
	{
		wait 400

		remove
	}
}

hqdoor
{
	spawn
	{
		wait 400

		remove
	}
}




wall
{
	spawn
	{
		wait 400
                setstate wall_toi invisible

		remove
	}

}

antenna
{
        spawn
        {
                wait 200
                faceangles 0 0 -90 2000
        }

        
}
	
maps_toi
{ 
   	spawn 
   	{ 
      		wait 400 

      		remove
  	} 
}

maps
{ 
   	spawn 
   	{ 
      		wait 400 

      		remove
  	} 
}

goldbars_cm_marker
{ 
   	spawn 
   	{ 
      		wait 400 

      		remove
  	} 
}

brick
{ 
   	spawn 
   	{ 
      		wait 400 

      		remove
  	} 
}
	
// -----------------
// TANK
// -----------------
tank
{
	spawn
	{
		wait 100
		remove
	}
}

tank_disabler
{
	spawn
	{
		wait 100
		remove
	}
}

tank_enabler
{
	spawn
	{
		wait 100
		remove
	}
}

tank_trigger
{
	spawn
	{
		wait 200
		remove
	}
}

tank_build
{
	spawn
	{
		wait 100
		remove
	}
}

tank_construct
{
	spawn
	{
		wait 100
		remove
	}
}



tank_smoke
{
	spawn
	{
		wait 100
		remove
	}
}

tank_flash
{
	spawn
	{
		wait 100
		remove
	}
}

tank_shooter
{
	spawn
	{
		wait 100
		remove
	}
}

tank_rtrack
{
	spawn
	{
		wait 100
		remove
	}
}

tank_ltrack
{
	spawn
	{
		wait 100
		remove
	}
}

tank_turret
{
	spawn
	{
		wait 100
		remove
	}
}

tank_shell
{
	spawn
	{
		wait 500
		remove
	}
}

rubble2_damaged
{
	spawn
	{
		wait 500
		remove
	}
}







// MG

houseMG42
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2
      trigger self startup 
       
   } 

   buildstart final 
   { 
   } 

   built final 
   {  
      setstate houseMG42_model default 
      setstate houseMG42_materials invisible 

      // Some kind of UI pop-up to alert players 
      wm_announce   "Allied team has built the house mg42!" 
   } 

   decayed final 
   { 
      trigger self startup 
   } 

   death 
   { 
      trigger self startup 
      // Some kind of UI pop-up to alert players 
      wm_announce   "Axis team has destroyed the house mg42!" 
   } 

   trigger startup 
   {  
      setstate houseMG42_model invisible 
      setstate houseMG42_materials default 
      repairmg42 houseMG42_model
   } 
} 


bridgeMG42 
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      trigger self startup 
   } 

   buildstart final 
   { 
   } 

   built final 
   {  
      setstate bridgeMG42_model default 
      setstate bridgeMG42_materials invisible 

      // Some kind of UI pop-up to alert players 
      wm_announce   "Allied team has built the bridge mg42!" 
   } 

   decayed final 
   { 
      trigger self startup 
   } 

   death 
   { 
      trigger self startup 
      // Some kind of UI pop-up to alert players 
      wm_announce   "Axis team has destroyed the bridge mg42!" 
   } 

   trigger startup 
   {  
      setstate bridgeMG42_model invisible 
      setstate bridgeMG42_materials default 
      repairmg42 bridgeMG42_model
   } 
} 

//CP

allied_compost_built
{
	spawn
	{
		wait 400
		trigger allied_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
	}

	buildstart final
	{
		setstate allied_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate allied_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger allied_compost_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger allied_compost_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_compost_built_model
{
	spawn
	{
		wait 400
		setstate allied_compost_built_model invisible
	}

	trigger enable_allied_features
	{
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 1 1

		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 2
		wm_objective_status 4 1 1
	}

	trigger disable_allied_features
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0

		wm_announce	"Axis team has destroyed the Allied Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
	}
}

axis_compost_built
{
	spawn
	{
		wait 400
		trigger axis_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
	}

	buildstart final
	{
		setstate axis_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate axis_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger axis_compost_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger axis_compost_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_compost_built_model
{
	spawn
	{
		wait 400
		setstate axis_compost_built_model invisible
	}

	trigger enable_axis_features
	{
		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
		sethqstatus 0 1

		wm_announce	"Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 1
		wm_objective_status 5 1 2
	}

	trigger disable_axis_features
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0

		wm_announce	"Allied team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"

		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
	}
}

